package com.tiejun.ge.mvc.entity.dto;

import com.tiejun.ge.mvc.common.validate.ValidationGroup;
import lombok.Data;

import javax.validation.constraints.*;

/**
 * @program: springboot
 * @description: UserDTO
 * @author: getiejun
 * @create: 2025-07-30 23:54
 **/
@Data
public class UserDTO {

    /**
     * 页数
     */
    private int pageNum;

    /**
     * 页大小
     */
    private int pageSize;

    /**
     * 用户姓名
     */
//    @NotEmpty(message = "用户名字不能为空")
    @NotEmpty(message = "用户名字不能为空", groups = ValidationGroup.ADD.class)
    private String username;

    /**
     * 用户年龄
     */
//    @NotNull(message = "用户年龄不能为空")
//    @Size(max = 100, message = "用户年龄格式在0-100之间")
    @NotNull(message = "用户年龄不能为空", groups = ValidationGroup.ADD.class)
    @Max(value = 100, message = "用户年龄格式在0-100之间", groups = ValidationGroup.ADD.class)
    @Min(value = 0, message = "用户年龄格式在0-100之间", groups = ValidationGroup.ADD.class)
    private Integer age;

    @NotNull(message = "用户id不能为空", groups = ValidationGroup.DETAIL.class)
    private Long id;
}
